package com.senney.practice.jedis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class TestJedisPool {
    public static void main(String[] args) {
        JedisPool jedisPool = JedisPoolUtil.getJedisPoolInstance();
        JedisPool jedisPool2 = JedisPoolUtil.getJedisPoolInstance();
        System.out.println(jedisPool == jedisPool2);
        Jedis jedis = null;
        try {
            jedis = jedisPool.getResource();
            System.out.println(jedis.get("k1"));
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            jedis.close();
        }
    }
}
